﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/AdminPage.master" AutoEventWireup="true"
    CodeFile="Scheduler.aspx.cs" Inherits="Pages_Scheduler" %>

<%@ Register TagPrefix="osd" Namespace="OboutInc.Scheduler" Assembly="obout_Scheduler_NET" %>
<%@ Import Namespace="Business" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="ViewControl" runat="server">
            <!-- start content-outer -->
            <div id="content-outer">
                <!-- start content -->
                <div id="content">
                    <div id="page-heading">
                        <h1>
                            <%=Resources.Resource.Scheduler%></h1>
                    </div>
                    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
                        <tr>
                            <th rowspan="3" class="sized">
                                <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowleft.jpg"
                                    width="20" height="300" alt="" />
                            </th>
                            <th class="topleft">
                            </th>
                            <td id="tbl-border-top">
                                &nbsp;
                            </td>
                            <th class="topright">
                            </th>
                            <th rowspan="3" class="sized">
                                <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowright.jpg"
                                    width="20" height="300" alt="" />
                            </th>
                        </tr>
                        <tr>
                            <td id="tbl-border-left">
                            </td>
                            <td>
                                <!--  start content-table-inner -->
                                <div id="content-table-inner">
                                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                        <tr valign="top">
                                            <td>
                                                <osd:Scheduler runat="server" ID="schedule" StyleFolder="pages/styles/default" Width="100%"
                                                    Height="500" ProviderName="System.Data.SqlClient" EventsTableName="Events" UserSettingsTableName="UserSettings"
                                                    CategoriesTableName="SchedulerCategories" OnClientBeforeDeleteEvent="handleBeforeDelete"
                                                    OnClientDeleteEvent="handleAfterDelete">
                                                </osd:Scheduler>
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/blank.gif" width="695"
                                                    height="1" alt="blank" />
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                    </table>
                                    <div class="clear">
                                    </div>
                                </div>
                                <!--  end content-table-inner  -->
                            </td>
                            <td id="tbl-border-right">
                            </td>
                        </tr>
                        <tr>
                            <th class="sized bottomleft">
                            </th>
                            <td id="tbl-border-bottom">
                                &nbsp;
                            </td>
                            <th class="sized bottomright">
                            </th>
                        </tr>
                    </table>
                    <div class="clear">
                        &nbsp;</div>
                </div>
                <!--  end content -->
                <div class="clear">
                    &nbsp;</div>
            </div>
        </asp:View>
        <asp:View ID="ViewError" runat="server">
            <asp:Literal ID="ltrError" runat="server"></asp:Literal>
        </asp:View>
    </asp:MultiView>
    <script type="text/javascript">
        function handleBeforeUpdate(sender, args) {

            if (args.OriginalEvent.StartTime - args.UpdatedEvent.StartTime != 0) {
                if (!confirm("The event [" + args.OriginalEvent.Subject + "] will be moved to " + args.UpdatedEvent.StartTime.format("HH:MM mm/dd/yyyy"))) {
                    alert("Update has been canceled.Event will be resumed back to its original time which is " + args.OriginalEvent.StartTime.format("HH:MM mm/dd/yyyy"));
                    args.UpdateEventCancel = true;
                }
            }

            //args.UpdateEventCancel = true;
        }
        function handleAfterUpdate(sender, args) {
            alert("Your event has been updated to " + args.UpdatedEvent.StartTime.format("HH:MM mm/dd/yyyy"));
        }        
    </script>
</asp:Content>
